<script>
$(document).ready(function() {
	<?php
	if ($updated == 1) echo 'showNoti("Nhân viên: '.$name.'", "Cập nhập thông tin thành công!", "Ok");';
	if ($failed == 1) echo 'showNoti("Nhân viên: '.$name.'", "Cập nhập thông tin thất bại!", "Err");';
	?>
});
</script>
<?php
echo form_open($action, array('id' => 'updateFrm'));
echo form_input(array('type' => 'hidden', 'name' => 'token', 'value' => $GLOBALS['var']['token']));
echo form_input(array('type' => 'hidden', 'name' => 'id', 'value' => $info['id']));
echo module_open();
?>
<tr class="no-border">
    <td>
    	<input type="hidden" class="tabId" value="<?php echo $GLOBALS['var']['mytab'] ?>" />
        <ul id="myTab" class="nav nav-tabs">
            <li class="hide640<?php echo ($GLOBALS['var']['mytab'] == 0 ? ' active' : '') ?>" onclick="set_mytab($(this));"><a href="#tabs-0" data-toggle="tab">Nhân sự</a></li>
            <li class="hide640<?php echo ($GLOBALS['var']['mytab'] == 1 ? ' active' : '') ?>" onclick="set_mytab($(this));"><a href="#tabs-1" data-toggle="tab">Cá nhân</a></li>
            <li class="hide640<?php echo ($GLOBALS['var']['mytab'] == 2 ? ' active' : '') ?>" onclick="set_mytab($(this));"><a href="#tabs-2" data-toggle="tab">Lương</a></li>
            <li class="dropdown active show640">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="current-tab-name">Danh sách quản lý</span> <span class="caret"></span></a>
                <ul class="dropdown-menu">
                	<li <?php echo ($GLOBALS['var']['mytab'] == 0 ? ' active' : '') ?>onclick="set_mytab($(this));"><a href="#tabs-0" data-toggle="tab">Nhân sự</a></li>
            		<li <?php echo ($GLOBALS['var']['mytab'] == 1 ? ' active' : '') ?>onclick="set_mytab($(this));"><a href="#tabs-1" data-toggle="tab">Cá nhân</a></li>
            		<li <?php echo ($GLOBALS['var']['mytab'] == 2 ? ' active' : '') ?>onclick="set_mytab($(this));"><a href="#tabs-2" data-toggle="tab">Lương</a></li>
                </ul>
            </li>
        </ul>
        <div id="myTabContent" class="tab-content">
	        <div id="tabs-0" class="tab-pane<?php echo ($GLOBALS['var']['mytab'] == 0 ? ' active' : '') ?>">
	        	<table cellpadding="0" cellspacing="0" width="100%" border="0">
					<tr>
						<td class="fr">
							<div class="tdleft clr320">Tên đăng nhập<?php echo($info['id'] == '' ? ' <span style="color:red">*</span>' : '') ?></div>
							<div class="tdright clr320">
								<?php if($info['id']): ?>
								<b><?php echo $info['username'] ?></b>
								<input type="hidden" name="username" value="<?php echo $info['username'] ?>" />
								<?php else: ?>
								<input type="text" data-required="1" id="username" name="username" value="" />
								<?php echo error_div('username', 'Vui lòng nhập username!'); ?>
								<?php endif; ?>
							</div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Nhóm nhân sự <span style="color:red">*</span></div>
							<div class="tdright">
								<?php
								if ($info['id'] != 1 && $info['id'] != $GLOBALS['var']['user_id'])
								{
									echo form_dropdown('level', $usergroups, $info['level'], 'data-required="1" id="level"');
									echo error_div('level', 'Vui lòng chọn nhóm nhân sự!');
								}
								else
								{
									echo get_data('usergroups', 'id = '.$info['level'], 'name_vn');
									echo form_input(array('type' => 'hidden', 'name' => 'level', 'value' => $info['level']));
								}
								?>
							</div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Chi nhánh / Cửa hàng</div>
							<div class="tdright"><?php echo form_dropdown('coso', $branchs, $info['coso']); ?></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Bộ phận / phòng ban</div>
							<div class="tdright"><?php echo form_dropdown('bophan', $parts, $info['bophan']); ?></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Chức vụ / vị trí</div>
							<div class="tdright"><?php echo form_dropdown('chucvu', $positions, $info['chucvu']); ?></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Email</div>
							<div class="tdright"><input type="text" name="email" value="<?php echo $info['email'] ?>" style="width: 250px;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Ngày vào làm</div>
							<div class="tdright"><input type="text" name="date_vaolam" class="date" value="<?php echo $info['date_vaolam'] ?>" style="width: 70px;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Ngày nghỉ việc</div>
							<div class="tdright"><input type="text" name="date_nghiviec" class="date" value="<?php echo $info['date_nghiviec'] ?>" style="width: 70px;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Mật khẩu mới<?php echo($info['id'] == '' ? ' <span style="color:red">*</span>' : '') ?></div>
							<div class="tdright"><input type="text"<?php echo($info['id'] == '' ? ' data-required="1"' : '') ?> id="new_password" name="new_password" autocomplete="off" />
							<?php echo error_div('new_password', 'Vui lòng nhập mật khẩu!'); ?></div>
						</td>
					</tr>
					<tr>
                        <td class='fr'>
                            <div class="tdleft">Quyền truy cập</div>
                            <div class="tdright">
                                <ul class="css3-radios">
                                    <li><label><input name="mode_right" type="radio" value="1"<?php echo($info['mode_right'] == 1 ? ' checked="checked"' : "") ?> /><span>Mặc định theo nhóm</span></label></li>
                                    <li><label><input name="mode_right" type="radio" value="0"<?php echo($info['mode_right'] == 0 ? ' checked="checked"' : '') ?> /><span>Phân quyền riêng</span></label></li>
                                </ul>
                            </div>
                        </td>
                    </tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Mức quản lý</div>
							<div class="tdright">
								<?php
								if ($info['id'] != 1 && $info['id'] != $GLOBALS['var']['user_id'])
								{
									echo form_dropdown('viewall', $GLOBALS['viewall'], $info['viewall']);
								}
								else
								{
									echo $GLOBALS['viewall'][$info['viewall']];
									echo form_input(array('type' => 'hidden', 'name' => 'viewall', 'value' => $info['viewall']));
								}
								?>
							</div>
						</td>
					</tr>
				</table>
			</div>
			<div id="tabs-1" class="tab-pane<?php echo ($GLOBALS['var']['mytab'] == 1 ? ' active' : '') ?>">
	        	<table cellpadding="0" cellspacing="0" width="100%" border="0">
	        		<tr>
						<td class="fr">
							<div class="tdleft">Họ tên</div>
							<div class="tdright"><input type="text" name="fullname" value="<?php echo $info['fullname'] ?>" style="width: 250px;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Nơi sinh</div>
							<div class="tdright"><input type="text" name="noisinh" value="<?php echo $info['noisinh'] ?>" style="width: 250px;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Ngày sinh</div>
							<div class="tdright"><input type="text" name="date_sinh" class="date" value="<?php echo $info['date_sinh'] ?>" style="width: 70px;" /></div>
						</td>
					</tr>
					<tr>
                        <td class='fr'>
                            <div class="tdleft">Giới tính</div>
                            <div class="tdright">
                                <ul class="css3-radios">
                                    <li><label><input name="gioitinh" type="radio" value="1"<?php echo($info['gioitinh'] == 1 ? ' checked="checked"' : "") ?> /><span>Nam</span></label></li>
                                    <li><label><input name="gioitinh" type="radio" value="0"<?php echo($info['gioitinh'] == 0 ? ' checked="checked"' : '') ?> /><span>Nữ</span></label></li>
                                </ul>
                            </div>
                        </td>
                    </tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Địa chỉ</div>
							<div class="tdright"><input type="text" name="diachi" value="<?php echo $info['diachi'] ?>" style="width: 250px;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">CMND</div>
							<div class="tdright"><input type="text" name="cmnd" value="<?php echo $info['cmnd'] ?>" style="width: 70px; text-align: right;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Ngày cấp</div>
							<div class="tdright"><input type="text" name="date_cmnd" class="date" value="<?php echo $info['date_cmnd'] ?>" style="width: 70px;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Nơi cấp</div>
							<div class="tdright"><input type="text" name="noicap_cmnd" value="<?php echo $info['noicap_cmnd'] ?>" style="width: 150px;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Điện thoại</div>
							<div class="tdright"><input type="text" name="phone" value="<?php echo $info['phone'] ?>" /></div>
						</td>
					</tr>
	        	</table>
	        </div>
	        <div id="tabs-2" class="tab-pane<?php echo ($GLOBALS['var']['mytab'] == 2 ? ' active' : '') ?>">
	        	<table cellpadding="0" cellspacing="0" width="100%" border="0">
					<tr>
                        <td class='fr'>
                            <div class="tdleft">Tính lương</div>
                            <div class="tdright">
                                <ul class="css3-radios">
                                    <li><label><input name="anluong" type="radio" value="1"<?php echo($info['anluong'] == 1 ? ' checked="checked"' : "") ?> /><span>Có</span></label></li>
                                    <li><label><input name="anluong" type="radio" value="0"<?php echo($info['anluong'] == 0 ? ' checked="checked"' : '') ?> /><span>Không</span></label></li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                    <tr>
						<td class="fr">
							<div class="tdleft">Lương căn bản</div>
							<div class="tdright"><input type="text" name="luong_cb" class="money" value="<?php echo number_format($info['luong_cb']) ?>" style="width: 70px; text-align: right;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Phụ cấp trách nhiệm</div>
							<div class="tdright"><input type="text" name="phucap_trachnhiem" class="money" value="<?php echo number_format($info['phucap_trachnhiem']) ?>" style="width: 70px; text-align: right;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Phụ cấp chuyên cần</div>
							<div class="tdright"><input type="text" name="phucap_chuyencan" class="money" value="<?php echo number_format($info['phucap_chuyencan']) ?>" style="width: 70px; text-align: right;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Phụ cấp công tác phí</div>
							<div class="tdright"><input type="text" name="phucap_congtac" class="money" value="<?php echo number_format($info['phucap_congtac']) ?>" style="width: 70px; text-align: right;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Phụ cấp xăng</div>
							<div class="tdright"><input type="text" name="phucap_xang" class="money" value="<?php echo number_format($info['phucap_xang']) ?>" style="width: 70px; text-align: right;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Mức hoa hồng %</div>
							<div class="tdright"><input type="text" name="muchoahong" class="money" value="<?php echo number_format($info['muchoahong']) ?>" style="width: 70px; text-align: right;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Mức thưởng</div>
							<div class="tdright"><input type="text" name="mucthuong" class="money" value="<?php echo number_format($info['mucthuong']) ?>" style="width: 70px; text-align: right;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Điều kiện thưởng<div class="note">Mức doanh số tháng</div></div>
							<div class="tdright"><input type="text" name="dkthuong" class="money" value="<?php echo number_format($info['dkthuong']) ?>" style="width: 70px; text-align: right;" /></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft">Tiền bảo hiểm</div>
							<div class="tdright"><input type="text" name="tien_bh" class="money" value="<?php echo number_format($info['tien_bh']) ?>" style="width: 70px; text-align: right;" /></div>
						</td>
					</tr>
	        	</table>
	        </div>
		</div>
	</td>
</tr>
<?php
echo module_close();
echo form_close();
?>